
<script setup lang="ts">
// 1.导入defineStore 返回的哪个对象
import { useCounterStore } from '@/stores/counter';

const store=useCounterStore()

store.count
import { useJokeStore } from '@/stores/joker';
const store1=useJokeStore()

</script>

<template>
  <h2>我的页面</h2>
  <h3>pinia 中的数据{{ store.count }}</h3>
  <h3>pinia 中的双倍数据{{ store.doubleCount }}</h3>
  <button @click="store.increment()">点击累加</button>
  <h1>笑话</h1>
  <p>{{ store1.joke }}</p>
  <button @click="store1.refreshJoke()">刷新笑话</button>

</template>

<style scoped>

</style>
